<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * Class CreateStaffPeriodFeesTable.
 */
class CreateStaffPeriodFeesTable extends Migration
{
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('staff_period_fees', function(Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('period_id');
            $table->unsignedInteger('staff_id');
            $table->unsignedInteger('dorm_days')->default(0);
            $table->decimal('electric_fee');
            $table->decimal('water_fee');
            $table->decimal('manage_fee');
            $table->decimal('deposit_fee')->default(0);
            $table->unsignedInteger('adjust_user_id')->nullable();
            $table->decimal('adjust_fee')->nullable();
            $table->string('adjust_reason')->nullable();
            $table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('staff_period_fees');
	}
}
